#include <iostream>
#include <Windows.h>
#include "DXGICapture.h"

#pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )

int main() {
    SetConsoleOutputCP(CP_UTF8); // 纠正UTF-8 显示乱码问题
    time_t start,end;
    DXGICapture cam;
    bool bExit = false;
    int timeSx = 0;
    while (!bExit){
        start = GetTickCount();
        if (cam.Update()) {
            if(!cam.BitmapToShow())
                break;
        }
        end = GetTickCount();
        timeSx++;
        if(ceil(start/1000) != ceil(end/1000)){
            cam.SetFps(timeSx); //更新帧率
            timeSx = 0;
        }
    }
    return 0;
}

